package cz.salixosft.bugreporter.bugreporter.example.mantis;

import cz.salixsoft.bugreporter.*;
import cz.salixsoft.bugreporter.adapter.mantis.MantisConnectorManagerImpl;
import java.math.BigInteger;
import org.mantis.ta.MantisManager;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        System.out.println( "Test mantis bug Reporting" );
        
        // Creates the bug connector manager. It should be set via some DI tool 
        // like Spring
        MantisManager mantisManager = new MantisManager("http://mantis.url", "login", "password");
        BugConnetionManager manager = new MantisConnectorManagerImpl(mantisManager, BigInteger.ONE);

        // Create a bug.
        Bug bug = new DefaultBugImpl("Some summary", "Some description", Priority.HIGH, Severity.HIGH);
        
        // Send the bud to bug tracking tool
        manager.createBug(bug);
        
        // And ... that is all.
    }
}
